/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bbd.crawler.job;

import bbd.crawler.job.fwk.BaseThreadedJob;
import bbd.crawler.url.fwk.URLHandlerInterface;

import bbd.crawler.util.Console;

/**
 *
 * @author Amogh
 */
public class ThreadedArtistInfoJob extends BaseThreadedJob {

    private URLHandlerInterface urlHandler = null;

    //--------------------------------------------------------------------------
    /** Javadoc here */
    public ThreadedArtistInfoJob ( URLHandlerInterface handler ) {

        urlHandler = handler;
        
    } // end default constructor

    //--------------------------------------------------------------------------
    /** Javadoc here */
    public Object getJobOutput() {
        throw new UnsupportedOperationException ("Not supported yet.");
    } // end method getJobOutput

    //--------------------------------------------------------------------------
    /** Javadoc here */
    public void execute() {

        try {

            while ( urlHandler.hasNext() ) {

                Console.debug ( "ThreadedArtistInfoJob.execute", "-------------------------------------------------------------" );
                Console.debug ( "ThreadedArtistInfoJob.execute", "Artist - " + urlHandler.getcurrentValue() );

                processUrl ( urlHandler.getUrl() );
            }
        }
        catch (Exception ex) {
            Console.error ( "ThreadedArtistInfoJob.execute", "EXCEPTION - " + ex.getMessage() );
        }

    } // end method execute

} // end class ThreadedArtistInfoJob
